#define _CRT_SECURE_NO_WARNINGS 1
#include<assert.h>
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>

typedef int HeapDataType;

typedef struct Heap {
	HeapDataType* data;
	int capacity;
	int size;
}Heap;

void HeapInit(Heap* p);
void HeapDestory(Heap* p);
bool HeapEmpty(Heap* p);
int HeapSize(Heap* p);
int HeapTop(Heap* p);
void Swap(HeapDataType* p1, HeapDataType* p2);
void AdjustUp(HeapDataType* arr, int child);
void HeapPush(Heap* p, HeapDataType x);
void AdjustDown(HeapDataType* arr, int EndSubscript, int parent);
void HeapPop(Heap* p);
void HeapCreate(Heap* p, HeapDataType* ArrOfData, int size);